#ifndef __INVADER_H__
#define __INVADER_H__

#include <QLabel>

/**
 * An enememy space invader
 */
class Invader : public QLabel
{
  Q_OBJECT

public:
  /**
   * Invader types, also the score you get for destroying them
   */
  typedef enum
  {
    InvaderNone = 0,
    InvaderOne = 30,
    InvaderTwo = 20,
    InvaderThree = 10
  } InvaderType;

  /**
   * @param invaderGif filename of the Invader animation GIF
   * @param type type of this Invader
   * @param parent parent of this Invader
   */
  Invader (const QString &invaderGif, InvaderType type, QWidget *parent = 0);

  /**
   * @returns the type this Invader is
   */
  InvaderType getType () const { return _type; }

  /**
   * Probability that an invader will show at the tank
   */
  static int shootPercent;

public slots:
  /**
   * Advances the Invader to the next frame if its animation
   */
  void advanceFrame ();

signals:
  /**
   * Emitted when this invader shoots at the tank
   */
  void shoots ();

private:
  QMovie *_movie;
  InvaderType _type;
};

#endif
